import 'package:flutter/material.dart';
import 'package:flutter_chat/common/style/styles.dart';
import 'package:flutter_chat/common/widget/widgets.dart';
import 'package:flutter_chat/pages/application/pages/user/widget/cell_info.dart';

import 'logic.dart';

class UserInfoPage extends CustomGetView<UserInfoLogic> {
  const UserInfoPage({super.key});

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: customAppBar(
        "个人信息",
      ),
      body: ListView(
        physics: const BouncingScrollPhysics(
          parent: AlwaysScrollableScrollPhysics(),
        ),
        children: [
          CellInfo(
            title: "头像",
            widget: ImageWidget(
              "${logic.userStore.user.avatar}",
              size: 60,
              radius: AppTheme.radius,
              errorImage: const Icon(
                Icons.person_outline,
                size: 40,
                color: Colors.white,
              ),
            ),
          ),
          const Divider(height: 1),
          CellInfo(
            title: "昵称",
            widget: Text(
              "${logic.userStore.user.nickname}",
              style: const TextStyle(
                color: AppTheme.infoColor,
              ),
            ),
          ),
          const Divider(height: 1),
          CellInfo(
            title: "账号",
            widget: Text(
              "${logic.userStore.user.username}",
              style: const TextStyle(
                color: AppTheme.infoColor,
              ),
            ),
          ),
        ],
      ),
    );
  }
}
